/**
 * @format
 */

import PriorityQueue from '../src/common/priorityQueue'

// it('renders correctly', () => {
//   renderer.create(<App />);
// });


for (let i = 0; i < 128; i = i + 1) {
  let a = []
  let q = new PriorityQueue()

  const MAXJ = 1024
  for (let j = 0; j < MAXJ; j = j + 1) {
    let n = Math.floor(Math.random() * MAXJ)
    a.push(n)
    q.push(PriorityQueue.wrap(n, {}))
  }

  a.sort(function (a, b) {
    return b - a
  })
  // for (let j = 0; j < 10; j = j + 1) {
  //   console.log(a[j] + ' ' + q.pop().v)
  // }

  it('sort valid', () => {
    for (let j = 0; j < MAXJ; j = j + 1) {
      // console.log(a[j] + ' ' + q.pop().getWeight())
      expect(q.pop().getWeight()).toBe(a[j])
    }
  })
}



